package vip.zhenzicheng.controller;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import vip.zhenzicheng.domain.User;
import vip.zhenzicheng.service.UserServiceImpl;

/**
 * @author zhenzicheng
 * @date 2023-02-23 18:43
 */
@RestController
public class UserController implements InitializingBean {
  @Autowired
  private UserServiceImpl userService2;

  @GetMapping("/user/{uid}")
  public User findUser(@PathVariable String uid) {
    return userService2.getUser(uid);
  }

  @Override
  public void afterPropertiesSet() throws Exception {
    System.out.println(userService2);
  }
}
